/*
 * @(#)Utilites.java 0.0.1-SNAPSHOT
 * Copyright Group B
 */

package grupb.upf.util;

import java.util.StringTokenizer;

/**
 * <p>This static class Utilities, it contains some util methods.</p>
 *
 * @version    0.0.1-SNAPSHOT
 * @author     Group B
 */
public final class Utilities {
    /**
     * Method to get the name of the user without @... and the resource.
     * @param n the String to parse
     * @return the clean name
     */
    public static String getName(final String n) {
            final StringTokenizer st =
                new StringTokenizer(n, "@");
            return st.nextToken();
    }
    /**
     * Method to get the name of the user without the resource.
     * @param n the String to parse
     * @return the clean username
     */
    public static String getUserName(final String n) {
            final StringTokenizer st =
                new StringTokenizer(n, "/");
            return st.nextToken();
    }
}
